#include "widget.h"
#include "ui_widget.h"
#include <QLabel>
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    QRect rect = this->geometry();
    //qDebug()<<rect;
    ui->setupUi(this);
    QPixmap pixmap(":/dog.jpg");
    ui->label->setPixmap(pixmap);
    ui->label->setScaledContents(true);
    ui->label->setGeometry(0,0,rect.width(),rect.height());
    //qDebug()<<ui->label->geometry();
}

Widget::~Widget()
{
    delete ui;
}

void Widget::resizeEvent(QResizeEvent *event)
{
    //qDebug()<<this->geometry();
    QRect rect = this->geometry();
     ui->label->setGeometry(0,0,rect.width(),rect.height());
}

